package com.changanw.askforleavedemo.task;

import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * @author changanw
 * @description
 * 审批通过的服务类
 * @date 2023/11/11 10:23
 */
public class ApproveServiceTask implements JavaDelegate {
  private static final Logger logger = LoggerFactory.getLogger(ApproveServiceTask.class);

  @Override
  public void execute(DelegateExecution delegateExecution) {
    Map<String, Object> variables = delegateExecution.getVariables();
    //提交请假申请的用户名
    Object name = variables.get("name");
    //请假的天数
    Object days = variables.get("days");
    logger.info("{} 请假 {} 天的申请通过审批", name, days);
  }
}
